/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package model.Entity.Web;

import java.io.Serializable;
import java.math.BigInteger;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author user12
 */
@Entity
@Table(name = "WEB_STAFF_COURSE_CONTENT")
@NamedQueries({
    @NamedQuery(name = "WebStaffCourseContent.findAll", query = "SELECT w FROM StaffCourseContent w"),
    @NamedQuery(name = "WebStaffCourseContent.findByCourseNo", query = "SELECT w FROM StaffCourseContent w WHERE w.staffCourseContentPK.courseNo = :courseNo"),
    @NamedQuery(name = "WebStaffCourseContent.findByActivityCode", query = "SELECT w FROM StaffCourseContent w WHERE w.staffCourseContentPK.activityCode = :activityCode"),
    @NamedQuery(name = "WebStaffCourseContent.findByInstructorId", query = "SELECT w FROM StaffCourseContent w WHERE w.staffCourseContentPK.instructorId = :instructorId")})
public class StaffCourseContent implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected StaffCourseContentPK staffCourseContentPK;
    @Lob
    @Column(name = "COURSE_CONTENT")
    private String courseContent;

    public StaffCourseContent() {
    }

    public StaffCourseContent(StaffCourseContentPK staffCourseContentPK) {
        this.staffCourseContentPK = staffCourseContentPK;
    }

    public StaffCourseContent(BigInteger courseNo, BigInteger activityCode, BigInteger instructorId) {
        this.staffCourseContentPK = new StaffCourseContentPK(courseNo, activityCode, instructorId);
    }

    public StaffCourseContentPK getWebStaffCourseContentPK() {
        return staffCourseContentPK;
    }

    public void setWebStaffCourseContentPK(StaffCourseContentPK staffCourseContentPK) {
        this.staffCourseContentPK = staffCourseContentPK;
    }

    public String getCourseContent() {
        return courseContent;
    }

    public void setCourseContent(String courseContent) {
        this.courseContent = courseContent;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (staffCourseContentPK != null ? staffCourseContentPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof StaffCourseContent)) {
            return false;
        }
        StaffCourseContent other = (StaffCourseContent) object;
        if ((this.staffCourseContentPK == null && other.staffCourseContentPK != null) || (this.staffCourseContentPK != null && !this.staffCourseContentPK.equals(other.staffCourseContentPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "model.WebStaffCourseContent[ webStaffCourseContentPK=" + staffCourseContentPK + " ]";
    }
    
}
